$("#page").paging({
    nowPage: 1, // 当前页码
    pageNum: 8, // 总页码
    buttonNum: 6, //要展示的页码数量
    canJump: 0, // 是否能跳转。0=不显示（默认），1=显示
    showOne: 1, //只有一页时，是否显示。0=不显示,1=显示（默认）
    callback: function (num) { //回调函数
        $.ajax({
                url: '/pxx',
                type: 'get',
                data: {
                    pdduid: 4874450680399,
                    tab_id: 6074,
                    list_id: 'uoH1Nkiy4u_RecommendGoods_6074',
                    page: num,
                    size: 12,
                    content_type: 1,
                    anti_content: '0aoAfauUujtYY9EVINlY2vdds2eEvA4ZlqZD5Gpeftf_bvkxyD8yLzFNd04Kf - YHWFIUOKHLr95Lrg0QW94Q2AhoPHT5LY4aqREA50qoXXL8q0qyC99WEuLk0sdJGKmifGUBrUyxdi_jbGWf2rSmlltb2gSksLtGe34VJEG2kJutJ0AtF9Gd9Ydj6SMymOFNvUlzvy_iVAKyKWvv3M1xi16hX58J4lk2lR6eeUvN8dNpIYogOSKpYEpJmN_De5BAhB1m6 - zrvagjIZXSJucbhOcd0pP8vogPMmqQVtcZnoZkp0GOOZ_p8CHB - 6 ZZi1H0WYBow577dfO - a1g - KwwJ5LDW8qxb4C1AcDeHfqLloaogdv52w_ - o6 - 9 jxCdOoCjBDBPpw - jZzQpLpr033DFdXAgsppjsGC9m9WsUzI7tWkSsv0pJfks6_HP1lXEOHXbNZqZoqUY6uelfwemECvvdRM06i9ytUviU4L4tlP3yD43Yemh_cAsAOVv4uDo5Z1seA3SFzvc1HYHZYwWA6OV1vQ0yCaG8u5Iu9RjONTSM9VyvooM3kDkBcuKG6pDYD2 - l4DvBslWrJ0MJuNpHPvlZJy2bIlg0MZ_OkHSr8M_mcAZzpShY - EhfJl_esvDpf1ApXRtWiF1X2YN6u2cF7puoNyVhNlOA6iRxqS5nqyaxK52lH10 - LN3FL7GuhRI6t3ZD6DeeGeKd - oaD0ClI4gizjjsQ7aX00xuOwDqb1QuENkj - 3n BJxWxRGR_',
                },
                dataType: 'json',
                success: function (res) {

                    goods_list = res.goods_list
                    var html = ''
                    for (var i = 0; i < goods_list.length; i++) {
                        html += `<li goods-index =${i}>
                                   <a href="javascript:void(0)">
                                   <img src="${goods_list[i].hd_thumb_url}"
                                       alt="">
                               </a>
                               <h5>${goods_list[i].goods_name}</h5>
                               <p>
                                   <span>¥</span>
                                   <b>${(goods_list[i].normal_price/100).toFixed(2)}</b>
                               </p>
                           </li>`
                    }
                    $('.tab_list_main ul').html(html);
                }
            })
            .then(function () {
                $('.tab_list_main ul li').click(function () {


                    var index = $(this).attr('goods-index')
                    console.log(index);

                    localStorage.setItem('detail', JSON.stringify(goods_list[index]))

                    //  window.location.href = 'http://localhost:3000/goods-detail.html'
                    location.assign('./goods-detail.html')
                })
            })
    }
});